<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>评审信息管理</title>
	<meta name="decorator" content="default"/>
	<%-- <script src="${ctxStatic}/typeahead/bootstrap-typeahead.js" type="text/javascript"></script> --%>
	<script src="${ctxStatic}/bootstrap/2.3.1/docs/assets/js/bootstrap-typeahead.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			
			//设置重置按钮
			$("#btnReset").click(function(){
				$(':input','#searchForm').not(':button, :submit, :reset, .notReset').val('').removeAttr('checked').removeAttr('selected');
				$(".select2-chosen").text('');
				/**var form = $(this).parents("form:first");
				$(this).parents("form:first")[0].empty();
				$(this).parents("form:first")[0].reset();
//		         设置下拉选择
				 form.find("select").each(function(){
					 var option = $(this).find("option:selected");
					 var selectVal = option.val();
					 var selectText = option.html();
					 $(this).next("span").find(".textbox-value").val(selectVal);
					 $(this).next("span").find(".textbox-text").val(selectText);
				 });*/
			});
			
			/**导出excel*/
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认导出数据？", "系统提示", function(v, h, f) {
					if (v == 'ok') {
						var action = $("#searchForm").attr('action');
						$("#searchForm").attr("action","${ctx}/inv/review/export");
						$("#searchForm").submit();
						$("#searchForm").attr("action",action);
					}
				});
			});
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/inv/review/">评审信息查询</a></li>
		<li><a href="${ctx}/inv/review/form">评审信息登记</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="review" action="${ctx}/inv/review/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		<li>
		<label>评审名称：</label><form:input path="reviewName" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
		<li>
		    <label>经办人：</label>
			<input name="transactName" type="text" class="input-medium" maxlength="20" value="${review.transactName}" />
		</li>
		<li class="clearfix"></li>
		<li>
		    <label>评审日期：</label>
			<input name="reviewDateBegin" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${review.reviewDateBegin}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
		<label>至：</label>
			<input name="reviewDateEnd" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${review.reviewDateEnd}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
		</li>
		<li class="clearfix"></li>
		<li>
		
			<label>任务号：</label>
			<form:select path="taskNo" class="input-medium">
			   <form:option value=""></form:option>
				<form:options items="${fns:getDictList('INV_TASK_NO')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			
		</li>
			<li class="btns">
			<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
			<input id="btnReset" class="btn btn-reset" type="button" value="重置"/>
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>评审名称</th>
				<th>评审日期</th>
				<th>任务号</th>
				<th>评审金额</th>
				<th>评审人数</th>
				<th>评审人员</th>
				<th>总金额</th>
				<th>经办人</th>
				<th>状态</th>
				<th>录入人</th>
				<th>录入时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="review">
			<tr>
				<td><a href="${ctx}/inv/review/form?id=${review.id}">
							${review.reviewName}
				</a></td>
				<td><fmt:formatDate value="${review.reviewDate}" pattern="yyyy-MM-dd"/></td>
				<td>${fns:getDictLabel(review.taskNo,'INV_TASK_NO',review.taskNo)}</td>
				<td>${review.reviewFee}</td>
				<td>${review.reviewNum}</td>
				<td>${review.reviewUserName}</td>
				<td>${review.reviewTotalFee}</td>
				<td>${review.transactName}</td>
				<td>${review.status eq '0'?'未提交':'已提交'}</td>
				<td>
					${review.createBy.name}
				</td>
				<td><fmt:formatDate value="${review.createDate}" pattern="yyyy-MM-dd"/></td>
				<td>
				<c:if test="${review.status eq '0' }">
    				<a href="${ctx}/inv/review/form?id=${review.id}">修改</a>
					<a href="${ctx}/inv/review/delete?id=${review.id}" onclick="return confirmx('确认要删除该评审信息吗？', this.href)">删除</a>
				</c:if>
				<c:if test="${review.status eq '1' }">
				    <a href="${ctx}/inv/review/form?id=${review.id}">详情</a>
				</c:if>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>